package com.mercury.pattern._07_decorator.seasoning;

import com.mercury.pattern._07_decorator.Drink;

/**
 *
 */
public class Seasoning extends Drink {
    Drink drink;

    public Seasoning(Drink drink) {
        this.drink = drink;
    }

    @Override
    public float cost() {
        //getPrice: 当前调料的金额
        //cost: 被装饰物所花费的总额
        return super.getPrice() + drink.cost();
    }
}